package com.jackey.sms.service.impl;

import com.jackey.sms.dao.UserDao;
import com.jackey.sms.pojo.User;
import com.jackey.sms.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 小伟
 * @version V1.0
 * @Package com.jackey.sms.service.impl
 * @date 2020/12/18 9:10
 * @Copyright © 2020-2021 郑州恒星科技有限责任公司
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserDao userDao;

    @Override
    public User login(String mobile, String password) {
        User user = userDao.findByMobile(mobile);
        if (user != null) {
            if (password.equals(user.getPassword())) {
                return user;
            }
        }
        return null;
    }

}
